<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的预约 - 五四宪法历史资料陈列室</title>
    <link rel="stylesheet" href="/static/pc/css/style.css">
    <script src="/static/pc/js/jquery.min.js"></script>
    <link rel="stylesheet" href="/static/pc/css/bootstrap.min.css">
</head>
<body>
<div class="head">
    <img src="/static/pc/img/head.jpg" alt="">
</div>
<div class="main">
    <div class="title_img"><img src="/static/pc/img/zg.png" alt=""></div>
    <div class="top_right">
        <a href="javascript:;" class="orderlist" class=" canshu1">展馆预约记录</a>
        <a href="activity_log?mobile={$Think.session.mobile}" class="orderlist another last" class=" canshu1">活动预约记录</a>
        {if condition="$Think.session.mobile"}  <span class="login_status">{$Think.session.mobile} </span><a class="login_status" href="home_tuichu" onclick="$('.layer2').show()"> 退出</a>{/if}
        <a class="back" href="/">返回首页</a>
        <a class="download" href="/参观介绍信.docx" download="/参观介绍信.docx">下载介绍信模板</a>
    </div>
    <div class="clear"></div>
    <div class="order_list">
        <p></p>
        <table rules=none>
            <thead>
            <tr>
                <th>状态</th>
                <th>预约类型</th>
                <th>预约时间</th>
                <th>参观场馆</th>
                <th>参观人数</th>
                <th>单位名称</th>
                <th>联系人</th>
                <th>联系方式</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {foreach $visit_list as $k=>$v}
                <tr>
                    <td><span>{$Think.config.visit_status[$v['status']]}</span></td>
                    <td>{if condition ="$v.type == 0"}个人{else/}团队{/if}</td>
                    <td>日期:{$v.day}<br>时间:{if condition ="$v.explain == 1"}{if condition ="$v.dinner == 0"}上午{else/}下午{/if}:{$v.arrival_time}{else/}{$v.between_time}{/if}</td>
                    <td>
                        {if condition ="$v.venue == 'A'"}北山街馆区{/if}
                        {if condition ="$v.venue == 'B'"}栖霞岭馆区{/if}
                        </td>
                    <td>{if condition ="$v.type == 0"} {else/}{$v.views}人{/if}</td>
                    <td>{$v.company}</td>
                    <td>{$v.name}</td>
                    <td>{$v.mobile}</td>
                    <td>
                        {if condition ="$v.status == 1"}
                        <button class="orange" onclick="edit('{$v.id}','{$v.venue}','{$v.day}','{$v.explain}','{$v.views}')">改签</button>
                        <button class="gray" onclick="del('{$v.id}')">取消</button>
                        {/if}
                        {if condition = "$v.status == 4 "}
                        <button style="background-color: #ccc">已完成</button>
                        <a href="/evaluate?id={$v.id}"><button class="red">评价</button></a>
                        {/if}
                        {if condition = "$v.status == 2 "}
                        <button class="gray1">已完成</button>
                        <a href=""><button class="gray1">已评价</button></a>
                        {/if}
                        {if condition = "$v.status == 3 "}
                        <button class="gray1">已取消</button>
                        {/if}
                        {if condition = "$v.status == 6 "}
                        <button class="gray1">未参观</button>
                        {/if}
                    </td>
                </tr>
            {/foreach}
            </tbody>
        </table>
    </div>
</div>
<div class="tip">
    <div>
        <a class="close wxts" href="javascript:;" onclick="hiddenTip()"><img src="/static/pc/img/close.png" alt=""></a>
        <div>
            <h3>温馨提示</h3>
            <p>1、请自驾车前来参观的观众，自行寻找车位，本馆不提供停车场。北山街馆区边西湖山庄有正规停车场，栖霞岭馆区边，栖霞岭路有少量地面车位。</p>
            <p>2、请团队预约的观众携带单位介绍信，否则将不予安排讲解。介绍信模板可在预约平台-【我的预约】中下载。</p>
            <p>3、本馆实行讲解预约制，请按照预约场次准时到场，否则出现无法安排讲解人员或入馆参观的情况，请予以谅解。</p>
            <p>4、本馆位于西湖景区，请合理安排出行时间，注意交通管制措施信息（单双号限行），外地观众请留意杭州限行规定。</p>
            <p>5、建议绿色出行。前往北山街馆区，您可搭乘公交7路、27路、117路等至新新饭店站。前往栖霞岭馆区，您可搭乘7路、27路、117路等至岳坟站。</p>
        </div>
        <a class="sure wxts" href="javascript:;" onclick="hiddenTip()">确定</a>
    </div>
</div>
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<script>
    function del(id){
        // var r=confirm("是否取消");
        var r=prompt("取消原因");
        if (r){
            $.ajax({
                type: 'POST',
                url: 'delyuyue',
                data: {"id":id,"reason":r},
                dataType:'json',
                success: function (result){
                    if(result.code == 1){
                        // alert(result.msg);
                        layer.alert(result.msg,{
                            // icon: 2,
                            title:false,
                            time:5000
                        })
                        window.location.reload();
                    }
                },
                error: function(result){
                    // alert(result.msg);
                    layer.alert(result.msg,{
                        // icon: 2,
                        title:false,
                        time:5000
                    })

                },
            });

        }
    }
    function edit(id,venue,day,explain,view){
        var url = "edit?id="+id+"&venue="+venue+"&day="+day+"&explain="+explain+"&views="+view;
        location.href = url;
    }

    var referrer = document.referrer;
    var name=referrer.substring(referrer.lastIndexOf("/")+1);   //截取
    var url= name.slice(0,7);  //获取 / 后的7位
    //console.log(url);
    if (url == "informa") {
        $('.tip').show();
    }

    function hiddenTip(){
        $('.tip').hide();
        $('.tip').text('');
        // window.location.reload();
    }

</script>
</body>
</html>